from appengine_django.models import BaseModel
from google.appengine.ext import db

class Users(BaseModel):
	loginName=db.StringProperty()
	password=db.StringProperty()
	creationTime=db.DateTimeProperty()
	isActive=db.BooleanProperty() #true - active
	
class Categories(BaseModel):
	name=db.StringProperty()
	title=db.StringProperty()
	priority=db.IntegerProperty() #p(10) > p(1)
	isActive=db.BooleanProperty() #true - active

class Articles(BaseModel):
	title=db.StringProperty()
	content=db.StringProperty()
	priority=db.IntegerProperty() #p(10) > p(1)
	creationTime=db.DateTimeProperty()
	updateTime=db.DateTimeProperty()
	creationUser=db.ReferenceProperty(Users)
	simpleOffset=db.IntegerProperty() #offset of the simple content, [0,offset]
	isPublished=db.BooleanProperty() #true - published
	
class Article_rel_Category(BaseModel):
	article=db.ReferenceProperty(Articles)
	category=db.ReferenceProperty(Categories)